script_enemy_main{

let angle=rand(0,360);

let character="SetsukoShinichi";
let cutin=character;
let dispelled=0;
let spellcards=1;
let spellcardnumber=5;
let damagerate=10;
let outfit=1;
outfit=(128*outfit)-128;
let usespell=0;
let bgfade=0;
let frame=0;
let time=0;
let miny=GetClipMinY; let maxy=GetClipMaxY; let minx=GetClipMinX; let maxx=GetClipMaxX;
let cx=GetCenterX; let cy=GetCenterY;

let BG1=("\script\Images\BackgroundLayers\setsuko1.png");
let BG2=("\script\Images\BackgroundLayers\setsuko2.png");

#include_function "script/Functions/SetSpellcardCommonData.txt";
#include_function "script/Functions/SpellcardNameLoad.txt";
#include_function "script/Functions/HealthBarLoad.txt";
#include_function "script/Functions/CutInLoad.txt";

@Initialize{
	LoadUserShotData("script\shots\ShotsSetsukoShinichi1.txt");

	LoadGraphic("\script\Images\BackgroundLayers\setsuko1.png");
	LoadGraphic("\script\Images\BackgroundLayers\setsuko2.png");

	SetScore(200000);
	SetLife(200);
	SetTimer(40);
	SetInvincibility(120);
	SetDamageRate(10,10); 
	MagicCircle(false);
	SetX(cx);
	SetY(miny-1000);

	SetCommonData("UseSpell1",0);
	SetCommonData("UseSpell2",0);
}
	
@MainLoop{

SetCollisionA(GetCommonData("Boss1X"),GetCommonData("Boss1Y"),16);
SetCollisionA(GetCommonData("Boss2X"),GetCommonData("Boss2Y"),16);
SetCollisionB(GetCommonData("Boss1X"),GetCommonData("Boss1Y"),16);
SetCollisionB(GetCommonData("Boss2X"),GetCommonData("Boss2Y"),16);
SetShotAutoDeleteClip(64,64,64,64);

Weakness(character);
#include_function "script/Functions/Weakness.txt";
if(GetCommonData("BombOn")==0){ damagerate=10; }
if(GetCommonData("BombOn")==1){ damagerate=4; }
SetDamageRate(damagerate*weaken,damagerate*weaken);

let difficulty="";
if(GetCommonDataDefault("Difficulty",2)==1){ difficulty="Easy"; }
if(GetCommonDataDefault("Difficulty",2)==2){ difficulty="Normal"; }
if(GetCommonDataDefault("Difficulty",2)==3){ difficulty="Hard"; }
if(GetCommonDataDefault("Difficulty",2)==4){ difficulty="Lunatic"; }

SpellcardName("[Speaking Is Silver, Silence Is Golden] ("~difficulty~")",spellcardnumber); 
HealthBar();
Portrait(cutin,1);


if(time==0){
CreateEnemyFromFile((GetCurrentScriptDirectory~"Setsuko-Shinichi - Speaking is Silver, Silence is Golden - Setsuko.txt"),GetCommonData("Boss1X"),GetCommonData("Boss1Y"),0,0,0);
CreateEnemyFromFile((GetCurrentScriptDirectory~"Setsuko-Shinichi - Speaking is Silver, Silence is Golden - Shinichi.txt"),GetCommonData("Boss2X"),GetCommonData("Boss2Y"),0,0,0);
}
if(time==45){ CreateEnemyFromFile(("script\Functions\spellcardwarning.txt"),0,0,0,0,0); }


time++; frame++;
if(usespell>0){ usespell--; } if(usespell<0){ usespell++; }
SetCommonData("Boss1X",GetX); SetCommonData("Boss1Y",GetY);

SetCommonData("NoAutoDispel",1);

#include_function "script/Functions/SpellcardName.txt";
#include_function "script/Functions/HealthBar.txt";
#include_function "script/Functions/CutIn.txt";
}

@BackGround{
	if(bgfade<255){bgfade+=5;}

	SetGraphicRect(0,0,300,400);
	SetGraphicScale(1.3,1.3);
	SetTexture(BG1);
	SetAlpha(bgfade/2);
	SetColor(255,255,255);
	SetRenderState(ALPHA);
	SetGraphicAngle(0,0,0);
	DrawGraphic(cx,cy);
	
	SetGraphicRect(0,0,250,320);
	SetGraphicScale(1.25,1.25);
	SetAlpha(bgfade);
	SetColor(180,180,180);
	SetTexture(BG2);
	DrawGraphic(cx,cy);
}

@DrawLoop{
}

@Finalize{
	SetCommonData("Conversation",1);

	NewPointData(spellcardnumber,GetCommonData("Difficulty"));
	#include_function "script/Functions/Main Menu/SpellcardDataAndPoints.txt";
	SetCommonData("NoAutoDispel",0);
	
	if(Continued==false && GotSpellCardBonus && GetCommonData("TrumpCardUnlocked")[4]==0){
		let spellcarddataarray=GetCommonData("NewTrumpCardsUnlocked");
		spellcarddataarray[4]=1;
		SetCommonData("NewTrumpCardsUnlocked",spellcarddataarray);	

		let spellcarddataarray=GetCommonData("TrumpCardUnlocked");
		spellcarddataarray[4]=1;
		SetCommonData("TrumpCardUnlocked",spellcarddataarray);

		let spellcarddataarray=GetCommonData("SpellcardData");
		spellcarddataarray[71]=0.5;
		SetCommonData("SpellcardData",spellcarddataarray);

		SaveCommonData;
	}
}

}